home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / Xm / XmosP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-30  |  6.4 KB  |  218 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. 
  3.  * ALL RIGHTS RESERVED 
  4. */ 
  5. /* 
  6.  * Motif Release 1.2.3
  7. */ 
  8. /*   $RCSfile: XmosP.h,v $ $Revision: 10.1 $ $Date: 1994/02/03 16:01:58 $ */
  9. /*
  10. *  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  11. /*
  12. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  13. #ifndef _XmosP_h
  14. #define _XmosP_h
  15.  
  16. #include <Xm/XmP.h>
  17.  
  18. /*
  19.  * Fix for 5222 - if NO_MEMMOVE is defined, some systems will still
  20.  *                require stdlib.h.
  21.  */
  22. #ifdef NO_MEMMOVE
  23. #define memmove( p1, p2, p3 )   bcopy( p2, p1, p3 )
  24. #endif
  25.  
  26. #ifndef X_NOT_STDC_ENV
  27. #include <stdlib.h> /* Needed for MB_CUR_MAX, mbtowc, mbstowcs and mblen */
  28. #endif
  29.  
  30. /* On Sun systems, mblen is broken. It doesn't return 0 when the
  31.    string is empty. Here's a patch. NOTE: On Sun systems, mblen
  32.    is a macro wrapper around mbtowc. Hence the implementation below. */
  33. #if defined(sun)
  34. #undef  mblen
  35. #define mblen(ptr, size) \
  36.   ((ptr && *(ptr) == '\0') ? 0 : mbtowc((wchar_t *)0, (ptr), (size)))
  37. #endif
  38.  
  39. #ifdef BOGUS_MB_MAX  /* some systems don't properly set MB_[CUR|LEN]_MAX */
  40. #undef MB_LEN_MAX
  41. #define MB_LEN_MAX 1 /* temp fix for ultrix */
  42. #undef MB_CUR_MAX
  43. #define MB_CUR_MAX 1 /* temp fix for ultrix */
  44. #endif /* BOGUS_MB_MAX */
  45.  
  46. /**********************************************************************/
  47. /* here we duplicate Xtos.h, since we can't include this private file */
  48.  
  49. #ifdef INCLUDE_ALLOCA_H
  50. #include <alloca.h>
  51. #endif
  52.  
  53. #ifdef CRAY
  54. #define WORD64
  55. #endif
  56.  
  57. /* stolen from server/include/os.h */
  58. #ifndef NO_ALLOCA
  59. /*
  60.  * os-dependent definition of local allocation and deallocation
  61.  * If you want something other than XtMalloc/XtFree for ALLOCATE/DEALLOCATE
  62.  * LOCAL then you add that in here.
  63.  */
  64. #if defined(__HIGHC__)
  65.  
  66. #if HCVERSION < 21003
  67. #define ALLOCATE_LOCAL(size)    alloca(size)
  68. pragma on(alloca);
  69. #else /* HCVERSION >= 21003 */
  70. #define    ALLOCATE_LOCAL(size)    _Alloca(size)
  71. #endif /* HCVERSION < 21003 */
  72.  
  73. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  74.  
  75. #endif /* defined(__HIGHC__) */
  76.  
  77.  
  78. #ifdef __GNUC__
  79.  
  80. #ifndef alloca /* gnu itself might have done that already */
  81. #define alloca __builtin_alloca
  82. #endif
  83.  
  84. #define ALLOCATE_LOCAL(size) alloca(size)
  85. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  86. #else /* ! __GNUC__ */
  87. /*
  88.  * warning: mips alloca is unsuitable, do not use.
  89.  */
  90. #if defined(vax) || defined(sun) || defined(apollo) || defined(stellar)
  91. /*
  92.  * Some System V boxes extract alloca.o from /lib/libPW.a; if you
  93.  * decide that you don't want to use alloca, you might want to fix it here.
  94.  */
  95. char *alloca();
  96. #define ALLOCATE_LOCAL(size) alloca(size)
  97. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  98. #endif /* who does alloca */
  99. #endif /* __GNUC__ */
  100.  
  101. #endif /* NO_ALLOCA */
  102.  
  103. #ifndef ALLOCATE_LOCAL
  104. #define ALLOCATE_LOCAL(size) XtMalloc(size)
  105. #define DEALLOCATE_LOCAL(ptr) XtFree(ptr)
  106. #endif /* ALLOCATE_LOCAL */
  107.  
  108. /* End of Xtos.h */
  109. /*****************/
  110.  
  111.  
  112. #ifdef __cplusplus
  113. extern "C" {
  114. #endif
  115.  
  116.  
  117. #define MATCH_CHAR 'P'  /* referenced in InitPath strings and in the files 
  118.              that uses it (ImageCache.c and Mrmhier.c) */
  119.  
  120. /* OS-dependent file info for VirtKeys */
  121.  
  122. #define XMBINDDIR "XMBINDDIR"
  123. #ifndef XMBINDDIR_FALLBACK
  124. #define XMBINDDIR_FALLBACK "/usr/lib/Xm/bindings"
  125. #endif
  126. #define XMBINDFILE "xmbind.alias"
  127. #define MOTIFBIND ".motifbind"
  128.  
  129. /* Vendor dependent macro for XmCvtXmStringToCT */
  130. /* Sample implementation treats unmapped charsets as locale encoded text. */
  131. #define _XmOSProcessUnmappedCharsetAndText(tag, ctext, sep, outc, outl, prev) \
  132.     processCharsetAndText(XmFONTLIST_DEFAULT_TAG, ctext, sep, outc, outl, prev)
  133.  
  134. /********    Private Function Declarations    ********/
  135. #ifdef _NO_PROTO
  136.  
  137. extern String _XmOSFindPatternPart() ;
  138. extern void _XmOSQualifyFileSpec() ;
  139. extern void _XmOSGetDirEntries() ;
  140. extern void _XmOSBuildFileList() ;
  141. extern int _XmOSFileCompare() ;
  142. extern String _XmOSGetHomeDirName() ;
  143. extern String _XmOSInitPath() ;
  144. extern void _XmSleep() ;
  145. extern int _XmMicroSleep() ;
  146. extern String _XmOSSetLocale() ;
  147. extern XmString _XmOSGetLocalizedString() ;
  148. extern String _XmOSBuildFileName() ;
  149. extern int _XmOSPutenv() ;
  150. #else
  151.  
  152. extern String _XmOSFindPatternPart( 
  153.                         String fileSpec) ;
  154. extern void _XmOSQualifyFileSpec( 
  155.                         String dirSpec,
  156.                         String filterSpec,
  157.                         String *pQualifiedDir,
  158.                         String *pQualifiedPattern) ;
  159. extern void _XmOSGetDirEntries( 
  160.                         String qualifiedDir,
  161.                         String matchPattern,
  162. #if NeedWidePrototypes
  163.                         unsigned int fileType,
  164.                         int matchDotsLiterally,
  165.                         int listWithFullPath,
  166. #else
  167.                         unsigned char fileType,
  168.                         Boolean matchDotsLiterally,
  169.                         Boolean listWithFullPath,
  170. #endif /* NeedWidePrototypes */
  171.                         String **pEntries,
  172.                         unsigned int *pNumEntries,
  173.                         unsigned int *pNumAlloc) ;
  174. extern void _XmOSBuildFileList( 
  175.                         String dirPath,
  176.                         String pattern,
  177. #if NeedWidePrototypes
  178.                         unsigned int typeMask,
  179. #else
  180.                         unsigned char typeMask,
  181. #endif /* NeedWidePrototypes */
  182.                         String **pEntries,
  183.                         unsigned int *pNumEntries,
  184.                         unsigned int *pNumAlloc) ;
  185. extern int _XmOSFileCompare( 
  186.                         XmConst void *sp1,
  187.                         XmConst void *sp2) ;
  188. extern String _XmOSGetHomeDirName() ;
  189. extern String _XmOSInitPath( 
  190.                         String file_name,
  191.                         String env_pathname,
  192.                         Boolean *user_path) ;
  193. extern void _XmSleep( 
  194.                         unsigned int secs) ;
  195. extern int _XmMicroSleep( 
  196.                         long secs) ;
  197. extern String _XmOSSetLocale( 
  198.                         String locale) ;
  199. extern XmString _XmOSGetLocalizedString( 
  200.                         char *reserved,
  201.                         Widget widget,
  202.                         char *resource,
  203.                         String string) ;
  204. extern String _XmOSBuildFileName(
  205.             String file,
  206.             String path) ;
  207. extern int _XmOSPutenv(
  208.                char *string);
  209. #endif /* _NO_PROTO */
  210. /********    End Private Function Declarations    ********/
  211.  
  212. #ifdef __cplusplus
  213. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  214. #endif
  215.  
  216. #endif /* _XmosP_h */
  217. /* DON'T ADD ANYTHING AFTER THIS #endif */
  218.